package orm;

import java.io.File;
import java.util.List;

import com.imonsoft.common.util.FileUtil;

/**
 * 
 * @author LiQianHui
 * @date 2013-04-17
 * @version 2013
 */
public class GenerateSqlmapConfig {

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		String objPath = System.getProperty("user.dir").replace(File.separatorChar, '/');
		String basePath = "config/orm/sqlmap";
		String baseXml = "<sqlMap resource=\"$filePath$\" />";
		List<File> list = FileUtil.findAllFile(basePath, "xml");
		String tempPath = null;
		for (File file : list) {
			tempPath = file.getAbsolutePath();
			tempPath = tempPath.replace('\\', '/').replace(objPath + "/config/", "");
			System.out.println(baseXml.replace("$filePath$", tempPath));
		}
	}
}
